package cn.iocoder.yudao.module.example.dubbo.controller.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.example.dubbo.service.IDubboExampleServer;
import io.swagger.v3.oas.annotations.Operation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@RestController
@RequestMapping("/example/dubbo")
@Validated
public class AppDubboExampleController {
    @DubboReference
    private IDubboExampleServer dubboExampleServer;

    @GetMapping("/call")
    @Operation(summary = "call")
    public CommonResult<String> call() {
        final String callRes = dubboExampleServer.call();
        return success(callRes);
    }

}
